<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class PivotScheduleTaiKhoanTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('Schedule_Tai_khoan', function(Blueprint $table) {
			$table->increments('id');
			$table->integer('Schedule_id')->unsigned()->index();
			$table->integer('Tai_khoan_id')->unsigned()->index();
			$table->foreign('Schedule_id')->references('id')->on('Schedules')->onDelete('cascade');
			$table->foreign('Tai_khoan_id')->references('id')->on('Tai_khoans')->onDelete('cascade');
		});
	}



	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('Schedule_Tai_khoan');
	}

}
